package com.luotat.employeeclient.client;

import com.luotat.pojo.employee.Employee;
import com.luotat.pojo.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


@FeignClient(name = "employee-service", fallback = EmployeeServiceFallback.class)
public interface EmployeeServiceImpl
{
    /**
     * 添加员工
     */
    @PostMapping("/api/employee")
    Result insert(@RequestBody Employee employee);

    /**
     * 删除员工
     */
    @DeleteMapping("/api/employee/{id}")
    Result delete(@PathVariable("id") Integer id);

    // 修改员工
    @PutMapping("/api/employee")
    Result update(@RequestBody Employee employee);

    /**
     * 根据id查询员工
     */
    @GetMapping("/api/employee/{id}")
    Result getById(@PathVariable("id") Integer id);

    /**
     * 查询所有员工
     */
    @GetMapping("/api/employee/getAll")
    Result getAll();
}